feat(app-builder): add user-initiated new chat session#1720
Open
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
Open
feat(app-builder): add user-initiated new chat session#1720kilo-code-bot[bot] wants to merge 1 commit intomainfrom
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
Conversation
- introduce user_initiated session reason and forceNewSession flow to start a fresh chat on demand - update API, routers, and UI to support forcing a new cloud agent session when the user clicks New Chat, bypassing automatic session changes - add pendingNewSession state and actions to ProjectManager and AppBuilderChat to manage the new-chat lifecycle
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (10 files)
Reviewed by gpt-5.4-20260305 · 820,265 tokens |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a "New Chat" button to the app builder chat pane header, allowing users to start a fresh AI session within an existing project. The new session gets a clean LLM context while preserving the project's full codebase and previous session history.
User flow:
SquarePenicon in the chat header (disabled while streaming)forceNewSession: trueon the existingsendMessageendpoint; the old session collapses into an expandable history block via the existing session-change machineryArchitecture: The
forceNewSessionflag is handled at theProjectManagerlevel — it bypasses the session/streaming layers entirely and calls tRPC directly, then delegates to the existinghandleSessionChangedhandler. Zero changes to V1/V2 session or streaming code. No DB migration needed (thereasoncolumn is freeformtext).Verification
forceNewSessionpath inapp-builder-service.tsbypassesshouldCreateNewSessionand uses the existingcreateV1Session/createV2Sessionhelpers with the newuser_initiatedreasonpendingNewSessionstate resets correctly on send, cancel, and session creationVisual Changes
N/A — chat pane only; a
SquarePenicon is added to the header bar.Reviewer Notes
SquarePenbutton is a toggle: click to enter pending mode, click again to cancel. It is disabled whileisStreamingis true so users cannot trigger it mid-stream.sendMessageAsNewSessionfunction inProjectManager.tscalls tRPC directly (rather than going through the session layer) because the existing session must be ended server-side before the new one is created. The response triggershandleSessionChanged, which reuses all existing session-change UI logic.AppBuilderSessionReason.UserInitiated('user_initiated') is added to the schema constant but requires no migration since the column istext NOT NULLwith no DB-level constraint on values.